/*************阿里云的MMQTT *************/
#ifndef _MQTT_ALIT_H_
#define _MQTT_ALIT_H_

#include "mqtt_client.h"
#include "esp_log.h"
#include "mbedtls/md5.h"
#include "mbedtls/md.h"
#include "esp_wifi.h"
#include <stdio.h>
#include "aliot_dm.h"
#include "ctrl_data.h"


#define ALIOT_DEVICENAME          "ESP32_temperture_humility" //设备名称
#define ALIOT_DEVICESECRET        "7519a2c55476bf235682136140aa0c90"  //设备密钥
#define ALIOT_PRRODUCUTKEY        "k1x681Fg5vh"  //产品密钥

#define ALIOT_MQTT_URL   "mqtts://k1x681Fg5vh.iot-as-mqtt.cn-shanghai.aliyuncs.com"

//启动阿里云
void aliot_start();
//是否连接
char  is_connected_mqtt();
//上传数据(float)
void aliot_post_property_float(const char* name,float value);
//上传数据(int)
void aliot_post_property_int(const char* name,int value);
//上报属性回复
void aliot_property_ack(int code,const char* message);
//给接受到的数据发送到物模型中
void send_data_to_cloud(float temp_alarm_value,float humi_alarm_value);


#endif